function zhuce() {
	//清除提示信息
	$("#name_span").html("");
	$("#password_span").html("");
	$("#repeat_password_span").html("");
	$("#mailbox_span").html("");
	
	//获取请求参数
	var name = $("#name").val().trim();
	var password = $("#password").val().trim();
	var repeat_password = $("#repeat_password").val().trim();
	var mailbox = $("#mailbox").val().trim();
	console.log(name);
	console.log(password);
	console.log(repeat_password);
	console.log(mailbox);
	//检查格式
	var ok = true;
	//检测用户名
	if(name==""){
		ok = false;
		$("#name_span").html("用户名为空");
			
	}
	//检测密码
	if(password==""){
		ok = false;
		$("#password_span").html("密码为空");	
	}else	if(password.length>0&&password.length<6){
		ok = false;
		$("#password_span").html("密码长度小于6位");	
	}
	//检测确认密码
	if(repeat_password==""){
		ok = false;
		$("#repeat_password_span").html("确认密码为空");
	}else if(repeat_password!=password){
		ok = false;
		$("#repeat_password_span").html("与密码不一致");
	}
	//检测邮箱
	//var emailRegEx="^[a-zA-Z0-9_\\.-]+@([a-zA-Z0-9-]+\\.)+[a-zA-Z0-9]{2,4}$";
	//mailbox.matches(emailRegEx)
	if(mailbox==""){
		ok = false;
		$("#mailbox_span").html("邮箱为空");
	}
	
	if(ok){
		$.ajax({
			url:"user/add.do",
			type:"post",
			data:{"name":name,"password":password,"mailbox":mailbox},
			dataType:"json",
			success:function(result){
				if(result.status==0){//成功
					alert(result.msg);//提示注册成功
					$("#back").click();//返回到登录界面
				}else if(result.status==1){//用户名被占用
					$("#name_span").html(result.msg);
				}else if(result.status==2){//邮箱被占用
					$("#mailbox_span").html(result.msg);
				}else if(result.status==3){//邮箱格式不正确
					$("#mailbox_span").html(result.msg);
				}			
			},
			error:function(){
				alert("注册失败");
			}
		});
	}
}
